In many applications, it is desirable to extract textual information from an image by automatic means. For example, using a machine to read address labels without manual intervention is a labor and cost saving technique. One technique for automatic label address reading employs a charge-coupled device ("CCD") camera to capture an image of the address label area. The n.times.m image provided by the CCD camera is called a gray-scale image, because each of the n.times.m pixels in the image can assume a gray value between zero and a maximum value, where zero is black, the maximum value is white and the intermediate values are gray. Typically, the maximum value will be 255 or 1023. For most address label reading application, the gray-scale image must be converted to a binary image, where pixels take on only one of two values, 0 for black and 1 for white. In the binary image, black pixels correspond to foreground, usually text, while white pixels correspond to background. The process of converting from a gray-scale image to a binary image is called thresholding. After the image has been thresholded, the label can be read automatically using an optical character recognition ("OCR") process.
Unfortunately, many common thresholding methods have great difficulty separating foreground from background on address labels due to the large variety of labels. Labels can have different color backgrounds, different color text printing, blurs, blotches, belt burns, tape effects, low contrast text, graphics, and plastic windows. Text on labels can be dot matrix, laser printed, typewritten, or handwritten and can be of any one of a number of fonts. The variety of labels makes it difficult for many thresholding processes to adequately separate foreground text from background and may cause many erroneous foreground/background assignments. An erroneous assignment occurs when a background pixel is assigned a value of 0 (black) or a foreground text pixel is assigned a value of 1 (white). If the former case, noise is introduced into the resultant binary image, and this may lead to difficulty reading the label automatically using OCR. In the latter case, text that was present in the gray level image is removed, and again the OCR process may fail.
In addition to the requirement for accuracy, an automatic thresholding technique must be fast and efficient to be effective as a cost-savings technique. In many applications, automatic label readers are employed by mail and package delivery services, where automatic systems convey packages at a rate of up to 3600 per hour. At this rate, a label must be imaged and processed in less than one second in order to be completed before processing on the next label must begin. In order for the thresholding technique to be used in real time, therefore, it must threshold the gray-scale image in considerably less than one second to give the OCR techniques time to process the thresholded text image.
Thus there is a need for a thresholding method and apparatus that employs a set of fast algorithms for separating foreground text from background in a way that minimizes the number of foreground/background misassignments. There is also a need for the thresholding method and apparatus to be adaptable so that it may adjust to the wide variety of character fonts and other differences in text presentation.